import java.awt.BorderLayout;
import java.awt.TextArea;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JFrame;


public class InputWindow extends JFrame implements ActionListener{

	public TextArea textArea = new TextArea();
	public JButton acceptButton = new JButton("accept");
	BorderLayout bl = new BorderLayout();
	
	public InputWindow(){
		setLayout(bl);
		setSize(500, 500);
		acceptButton.addActionListener(this);;
		acceptButton.setActionCommand("accept");
		add(textArea, bl.CENTER);
		add(acceptButton, bl.SOUTH);
		setVisible(true);
	}

	@Override
	public void actionPerformed(ActionEvent e) {
		if(e.getActionCommand().equals(acceptButton.getActionCommand())){
			MyLogo.interpreter.interprete(textArea.getText());
		}
	}
	
}
